package com.taoyibao.hongcanting.ui.home.delegate;

import android.widget.TextView;

import com.taoyibao.hongcanting.R;
import com.taoyibao.hongcanting.base.delegate.BackToolbarDelegate;
import com.taoyibao.hongcanting.constant.CodeConstant;
import com.taoyibao.hongcanting.utils.CodeUtils;

/**
 * @author TangAnna
 * @description: 支付结果
 * @date :${DATA} 16:35
 */
public class PaymentResultDelegate extends BackToolbarDelegate {
    @Override
    public int getRootLayoutId() {
        return R.layout.activity_payment_result;
    }

    @Override
    public void initWidget() {
        super.initWidget();
        setTitle("支付结果");
        setHideLeftBack();
    }

    /**
     * @param way       支付方式
     * @param payAmount 支付金额
     */
    public void setData(int way, double payAmount) {
        switch (way) {
            case CodeConstant.PAY_WALLET:
                ((TextView) get(R.id.tv_payResult_way)).setText(CodeUtils.getIdString(R.string.string_wallet));
                break;
            case CodeConstant.PAY_WECHART:
                ((TextView) get(R.id.tv_payResult_way)).setText(CodeUtils.getIdString(R.string.string_wechart2));
                break;
            case CodeConstant.PAY_ALIPAY:
                ((TextView) get(R.id.tv_payResult_way)).setText(CodeUtils.getIdString(R.string.string_alipay));
                break;
        }
        ((TextView) get(R.id.tv_payResult_payAmount)).setText(CodeUtils.formatAmountUnit(payAmount));
    }
}
